from django.core.management.base import BaseCommand
from token_blacklist.models import UserDevice

class Command(BaseCommand):
    help = 'Clear all device records'

    def handle(self, *args, **kwargs):
        count = UserDevice.objects.count()
        UserDevice.objects.all().delete()
        self.stdout.write(
            self.style.SUCCESS(f'Successfully deleted {count} device records')
        )
